namespace GatherTogether
{
    namespace GatherItems
    {
        /// <summary>
        /// Contains information about a particular gather drop location.
        /// </summary>
        class Location
        {
            protected double m_xPosition = 0;
            protected double m_yPosition = 0;
            protected long m_gatherCount = 0;
            protected long m_harvestedTime = 0;
            protected long m_inspectedTime = 0;
            protected string m_sourceName = "";

            /// <summary>
            /// Default constructor uses initializers.
            /// </summary>
            public Location()
            {
            }

            /// <summary>
            /// Standard constructor, allows all members except for m_sourceName to be set explicitly.
            /// </summary>
            /// <param name="x"></param>
            /// <param name="y"></param>
            /// <param name="count"></param>
            /// <param name="harvested"></param>
            /// <param name="inspected"></param>
            public Location(double x, double y, long count, long harvested, long inspected)
            {
                m_xPosition = x;
                m_yPosition = y;
                m_gatherCount = count;
                m_harvestedTime = harvested;
                m_inspectedTime = inspected;
            }

            /// <summary>
            /// Accessor for the x coordinate of the location.
            /// </summary>
            public double x
            {
                get { return m_xPosition; }
                set { m_xPosition = value; }
            }

            /// <summary>
            /// Accessor for the y coordinate of the location
            /// </summary>
            public double y
            {
                get { return m_yPosition; }
                set { m_yPosition = value; }
            }

            /// <summary>
            /// Accessor for the number of times the location has been harvested.
            /// </summary>
            public long count
            {
                get { return m_gatherCount; }
                set { m_gatherCount = value; }
            }

            /// <summary>
            /// Accessor for the timestamp when the location was last harvested.
            /// </summary>
            public long harvested
            {
                get { return m_harvestedTime; }
                set { m_harvestedTime = value; }
            }

            /// <summary>
            /// Accessor for the timestamp when the location was last inspected.
            /// </summary>
            public long inspected
            {
                get { return m_inspectedTime; }
                set { m_inspectedTime = value; }
            }

            /// <summary>
            /// Accessor for the name of the source for this node. If the node has
            /// been harvested and transmitted by another player it will be the name
            /// of that player. If the node has been inspected but cannot be harvested,
            /// because the required skill was not available, then it will be "REQUIRE".
            /// Otherwise, it will be empty.
            /// </summary>
            public string source
            {
                get { return m_sourceName; }
                set { m_sourceName = value; }
            }
        }
    }
}